package com.test.views;

import com.test.R;

import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.drawable.NinePatchDrawable;
import android.os.Bundle;
import android.widget.ImageView;

/**
 * @author keshuangjie
 *
 */
public class NinthTurnBitmap extends Activity {
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.image);
		ImageView imageView = (ImageView) findViewById(R.id.image);
		NinePatchDrawable nineDrawable = 
				(NinePatchDrawable) getResources().getDrawable(R.drawable.ad_default);
		nineDrawable.setBounds(0, 0, 800, 200);
		Bitmap bitmap = Bitmap.createBitmap(800, 1000, Bitmap.Config.RGB_565);
		Canvas canvas = new Canvas(bitmap);
		nineDrawable.draw(canvas);
		imageView.setImageBitmap(bitmap);
	}

}
